<div class="sectionlinks">
    <ul>
        <li>
        <% if controller.action_name == "from_story" %>
            <%= link_to "study these words", {
                            :controller => 'word',
                            :action => 'study_story_words',
                            :id => @story.id} %>
            
        <% elsif controller.action_name == "index" %>
            <%= link_to "study all words", {
                :controller => 'word',
                :action => 'study'} %>
                
        <% elsif controller.action_name == "in_category" %>
            <%= link_to "study category words", {
                :controller => 'word',
                :action => 'study_category_words',
                :id => @category.id} %>
                
        <% end %>
        </li>
    </ul>
</div>